﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace 数组作为函数参数
{
    class Program
    {
        static int Sum(int[] nums)
        {
            int sum = 0;

            foreach (int i in nums)
            {
                sum += i;
            }

            return sum;
        }

        static void Main(string[] args)
        {
            int[] values = new int[5] { 1, 1, 1, 1, 1 };

            Console.WriteLine(Sum(values));
            Console.ReadKey();
        }

    }
}
